﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 图解算法数据结构._05_ReplaceSpace
{
    class MainProject
    {
        static void Main(string[] args)
        {
            Console.WriteLine(ReplaceSpace("We are happy."));
            Console.ReadKey();
        }

        public static string ReplaceSpace(string s)
        {
            string returnS = string.Empty;
            for (int i = 0; i < s.Length; i++)
            {
                if (s[i] == ' ')
                {
                    returnS += "%20";
                    continue;
                }
                returnS += s[i];
            }
            return returnS;
        }
    }
}
